/**
 * 
 */
package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.pojo.Discount;

/**
 * @author Fz
 * @date 2019年8月2日 上午10:51:14
 * @param 
 * @return
 */
public interface DiscountMapper {

	@Select("select * from discount")
	List<Discount> getAllD();
	
	@Update("UPDATE discount SET percent = #{percent} WHERE did = #{did}")
	int updateD(Discount discount);

	@Insert("INSERT INTO discount VALUES (default,#{dname},#{percent})")
	int addD(Discount discount);

	@Delete("DELETE FROM discount WHERE did=#{did}")
	int delD(String did);

	@Select("select * from discount where dname like #{message}")
	List<Discount> selD(String message);
	
	@Select("select percent from discount where dname=#{mtype}")
	float findDiscountB(String mtype);

	@Select("select percent from discount where dname='全场折扣'")
	float findDiscount();

}
